package yunjiao.apijson.extension.orm;

/**
 * ThreadLocal保存数据源标识
 *
 * @author yangyunjiao
 */
public class DataSourceContextHolder {
    private static final ThreadLocal<String> contextHolder = new ThreadLocal<>();

    public static void setDataSourceType(String dsType) {
        contextHolder.set(dsType);
    }

    public static String getDataSourceType() {
        return contextHolder.get();
    }

    public static void clearDataSourceType() {
        contextHolder.remove();
    }
}
